﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RVEAd.LiveClient.Controls
{
    public partial class AMPanel : UserControl
    {
        public DateTime Date { get; set; }

        public AMPanel()
        {
            InitializeComponent();
            this.Load += new EventHandler(AMPanel_Load);
        }

        void AMPanel_Load(object sender, EventArgs e)
        {
            if (!DesignMode)
            {
                LoadData();
            }
        }

        public void LoadData()
        {
            intervalGridAM1.IntervalName = "AM1";
            intervalGridAM1.Date = Date;
            intervalGridAM1.IntervalType = Business.IntervalEnum.AM1;

            intervalGridAM2.IntervalName = "AM2";
            intervalGridAM2.Date = Date;
            intervalGridAM2.IntervalType = Business.IntervalEnum.AM2;

            intervalGridAM3.IntervalName = "AM3";
            intervalGridAM3.Date = Date;
            intervalGridAM3.IntervalType = Business.IntervalEnum.AM3;

            intervalGridAM1.LoadData();
            intervalGridAM2.LoadData();
            intervalGridAM3.LoadData();
        }
    }
}
